<?=html::script('js/validator.js')?>
<div>
	<div class="box-h1">
		<h1 title="Customer Registration"><?=Kohana::lang('title.registration')?></h1>
		<div class="box1 sform">
			<form action="<?=url::site('customer/create')?>" onsubmit="return Validator.Validate(this,2)" method="post" id="register">
				<h3><?=Kohana::lang('site.username')?> & <?=Kohana::lang('site.password')?></h3>
				<ul><li>
					<span class="label"><?=Kohana::lang('site.username')?></span>
					<span class="required">*</span>
					<span><input name="username" id="reg_username" type="text" dataType="ASCII" msg="<?=Kohana::lang('site.input_msg_user_name')?>" onblur="checkUserName(this.value)"/><i class="ErrorMessage" id="__ErrorMessagePanel_username"></i></span>
				</li><li>
					<span class="label"><?=Kohana::lang('site.password')?></span>
					<span class="required">*</span>
					<span><input name="password" id="reg_password" type="password" dataType="Require" msg="<?=Kohana::lang('site.input_msg_password')?>"/></span>
				</li><li>
					<span class="label"><?=Kohana::lang('site.confirmpassword')?></span>
					<span class="required">*</span>
					<span><input name="confirm" dataType="Repeat" to="reg_password" msg="<?=Kohana::lang('site.input_msg_repassword_error')?>" type="password"/></span>
				</li></ul>
				<h3><?=Kohana::lang('site.personal_information')?></h3>
				<ul><li>
					<span class="label"><?=Kohana::lang('site.first_name')?></span>
					<span class="required">*</span>
					<span><input name="firstname" type="text" dataType="ASCII" msg="<?=Kohana::lang('site.input_msg_user_name')?>"/></span>
				</li><li>
					<span class="label"><?=Kohana::lang('site.last_name')?></span>
					<span class="required">*</span>
					<span><input name="lastname" type="text" dataType="ASCII" msg="<?=Kohana::lang('site.input_msg_user_name')?>"/></span>
				</li><li>
					<span class="label"><?=Kohana::lang('site.company')?></span>
					<span class="required"></span>
					<span><input name="company" type="text"/></span>
				</li></ul>
				<h3><?=Kohana::lang('site.contact_information')?></h3>
				<ul><li>
					<span class="label"><?=Kohana::lang('site.email')?></span>
					<span class="required">*</span>
					<span><input  id="reg_email" type="text" name="email" dataType="Email" msg="<?=Kohana::lang('site.input_msg_email_format_error')?>" onblur="checkUserEmail(this.value)"/><i class="ErrorMessage" id="__ErrorMessagePanel_email"></i></span>
				</li><li>
					<span class="label"><?=Kohana::lang('site.phone')?></span>
					<span class="required"></span>
					<span><input name="phone" type="text"/></span>
				</li><li>
					<span class="label"><?=Kohana::lang('site.fax')?></span>
					<span class="required"></span>
					<span><input name="fax" type="text"/></span>
				</li><li>
					<span class="label"></span>
					<span class="required"></span>
					<span><input type="Submit" value="<?=Kohana::lang('site.register')?>"/></span>
				</li></ul>
				<input type="hidden" name="returnurl" value="<?=$returnurl?>"/>
			</form>
		</div>
	</div>
</div>
<script type="text/javascript">
	function checkUserName(username)
	{
		if(/.+/.test(username))
		{
			ajax("<?=url::base()?>ajax/checkusername/"+username, 'script');
		}
		
		return false;
	}
	function checkUserEmail(email)
	{
		if(/.+/.test(email))
		{
			ajax("<?=url::base()?>ajax/checkuseremail/"+email, 'script');
		}
		
		return false;
	}
	function getZones(country_id, domID)
	{
		ajax("<?=url::base()?>ajax/getzones/"+country_id, 'update', domID);
	}
</script>